package cn.fintecher.gis.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class ReadProperties {

    public static String getMethodName(String key) throws IOException {
        ClassLoader loader = ReadProperties.class.getClassLoader();
        //2.通过类加载器获取与propertiesUtils编译在一起的classpath下的资源文件
        InputStream stream = loader.getResourceAsStream("method.properties");
        //3.创建properties文件读取的对象
        Properties properties = new Properties();
        //4.加载文件流对象
        properties.load(new InputStreamReader(stream, "GBK"));
        //5.读取内容
        String property = properties.getProperty(key);

        return property;
    }


    public static void main(String[] args) throws Exception {
        System.out.println(getMethodName("saveDepartment"));
    }
}

